package com.moon.dto;


import com.moon.entity.TAuction;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.List;

@Document(indexName = "esproduct", shards = 3, replicas = 2)
public class EsProduct {

    /**
     * 商品id
     */
    @Id
    private Long id;

    /**
     * 卖家id
     */
    @Field(name = "sellerId", analyzer = "ik_max_word", searchAnalyzer = "ik_max_word", type = FieldType.Long)
    private Long sellerId;

    /**
     * 商品名
     */
    @Field(name = "productName", analyzer = "ik_max_word", searchAnalyzer = "ik_max_word", type = FieldType.Text)
    private String productName;

    /**
     * 商品详情
     */
    @Field(type = FieldType.Keyword)
    private String productDetail;

    /**
     * 状态（0.未拍出，1.正在拍卖，2.已拍出）
     */
    @Field(name = "status", analyzer = "ik_max_word", searchAnalyzer = "ik_max_word", type = FieldType.Integer)
    private Integer status;

    /**
     * 商品图
     */
    @Field(type = FieldType.Keyword)
    private List<String> productImgList;

    /*
     * 竞拍室集合
     */
    @Field(type = FieldType.Keyword)
    private List<TAuction> auctionList;

    /*
     * 进行中的竞拍
     */
    @Field(type = FieldType.Keyword)
    private TAuction auction;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getSellerId() {
        return sellerId;
    }

    public void setSellerId(Long sellerId) {
        this.sellerId = sellerId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getProductDetail() {
        return productDetail;
    }

    public void setProductDetail(String productDetail) {
        this.productDetail = productDetail;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public List<String> getProductImgList() {
        return productImgList;
    }

    public void setProductImgList(List<String> productImgList) {
        this.productImgList = productImgList;
    }

    public List<TAuction> getAuctionList() {
        return auctionList;
    }

    public void setAuctionList(List<TAuction> auctionList) {
        this.auctionList = auctionList;
    }

    public TAuction getAuction() {
        return auction;
    }

    public void setAuction(TAuction auction) {
        this.auction = auction;
    }
}
